import type { FC, PropsWithChildren } from 'react'
import { context } from '../../../common/context';

const Index: FC<PropsWithChildren<{ style?: React.CSSProperties;className?: string;initMarginH?: number }>> = ({ children, initMarginH, ...props }) => {
  const { resume: { customization } } = context

  const { spacing } = customization
  const { module } = spacing
  const { marginVertical, marginHorizontal } = module || {}
  const customStyle: any = {
  }
  let initMarginHorizontal = 0
  if (initMarginH) {
    initMarginHorizontal = initMarginH
  }
  customStyle.padding = `${((marginVertical || 0))}mm ${(marginHorizontal || 0) + initMarginHorizontal}mm  ${(marginVertical || 0)}mm `
  return <div style={customStyle} {...props}>
    {
      children
    }
  </div>
}
export default Index
